package com.teapos.enumtype;

public enum OrderStatusEnum {
	
	TRADED(0, "未撤销"),
	CANCELD(1, "已撤销");
	
	private int code;
	private String desc;
	private OrderStatusEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static OrderStatusEnum getEnumByCode(int code) {
		OrderStatusEnum[] enums = OrderStatusEnum.values();
		for(OrderStatusEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
